package com.apes.auto.autoparts.vin;

import com.alibaba.fastjson.JSONObject;
import com.apes.auto.autoparts.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 功能：EPC（标准）目录
 *
 * @author xul
 * @create 2019-08-14 10:59
 */
@Component
public class EpcCatalogSearcher<T, R> implements CatalogSearcher<T, R> {

    @Autowired
    InnerCatalogSearcher innerCatalogSearcher;

    @Override
    public String[] getSource() {
        return new String[]{DataSource.EPC.name()};
    }

    @Override
    public R parse(T element) {
        return (R) innerCatalogSearcher.getEpcMenu((JSONObject) element);
    }

}
